package com.xique.door.bean.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xique.common.core.annotation.Excel;
import com.xique.common.datascope.annotation.NeedSetDictParam;
import com.xique.common.datascope.annotation.NeedSetValue;
import com.xique.common.core.web.domain.BaseEntity;
import com.xique.door.mapper.AreaMapper;
import com.xique.sys.api.domain.SysDept;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 车场对象 t_park_info
 *
 * @author ww
 * @date 2019-09-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ParkInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自动增量 */
    @NotNull
    private Long id;

    /** 服务商ID */
    @NotNull
    private Long deptId;

    @Excel(name = "服务商")
//    @NeedSetValue(beanClass = SysDeptMapper.class, params = "deptId", method = "selectDeptById",targetFiled = "deptName")
    private String deptName;

    /** 停车场名称 */
    @NotEmpty
    @Excel(name = "项目名称")
    private String name;

    /** 停车场编号（自动生成或手机号） */
    @NotEmpty
    @Excel(name = "项目编号", readConverterExp = "自动生成或手机号")
    private String code;

    /** 停车场性质 */
    private String parkNature;

    @Excel(name = "停车场性质")
    @NeedSetDictParam(dictType = "pk_park_nature", dictValue = "parkNature")
    private String parkNatureLabel;

    /** 总共停车位 */
    @Excel(name = "总车位数")
    private Long totalSpace;

    /** 经度 */
    //@Excel(name = "经度")
    private Double positionX;

    /** 纬度 */
    //@Excel(name = "纬度")
    private Double positionY;

    /** 负责人 */
    @Excel(name = "负责人")
    private String principal;

    /** 负责人电话 */
    @Excel(name = "负责人电话")
    private String principalPhone;

    /** 客服电话 */
    @Excel(name = "客服电话")
    private String servicePhone;

    /** 状态（normal-启用 pause-停用） */
    private String status;

    @NeedSetDictParam(dictType = "pk_status", dictValue = "status")
    @Excel(name = "状态", readConverterExp = "normal-启用 pause-停用")
    private String statusLabel;

    /** 表记录的状态（normal-正常 delete-删除） */
    private String recordStatus;

    /** 地址 */
    @Excel(name = "地址")
    private String address;

    private String province;
    /** 省 */
    @Excel(name = "省")
    @NeedSetValue(beanClass = AreaMapper.class, params = "province", method = "selectAreaByCode",targetFiled = "areaName")
    private String provinceName;

    private String city;
    /** 市 */
    @Excel(name = "市")
    @NeedSetValue(beanClass = AreaMapper.class, params = "city", method = "selectAreaByCode",targetFiled = "areaName")
    private String cityName;

    private String district;
    /** 区 */
    @Excel(name = "区")
    @NeedSetValue(beanClass = AreaMapper.class, params = "district", method = "selectAreaByCode",targetFiled = "areaName")
    private String districtName;

    /** （电子支付、商圈优惠、中央收费后允许车主免费逗留时间，单位：分钟） */
    @Excel(name = "", readConverterExp = "电=子支付、商圈优惠、中央收费后允许车主免费逗留时间，单位：分钟")
    private Long payStayTime;

    /** 图片保存天数 */
    @Excel(name = "图片保存天数")
    private Long pictureSaveDays;

    /** 数据保存天数 */
    @Excel(name = "数据保存天数")
    private Long dataSaveDays;

    /** 进场或出场相同或相似车牌触发流程的时间间隔（单位：秒） */
    @Excel(name = "进场或出场相同或相似车牌触发流程的时间间隔", readConverterExp = "单=位：秒")
    private Long triggerTime;

    /** 对接外部平台 */
    @Excel(name = "对接外部平台")
    private Long platformId;

    /** 月租车剩余多少天时开始广播 */
    @Excel(name = "月租车剩余多少天时开始广播")
    private Long broadcastDays;

    /** 是否商圈优惠 */
    @Excel(name = "电子停车卷")
    private String discount;

    /** 停车场售后信息字段 */
    @Excel(name = "停车场售后信息字段")
    private String afterSale;

    /** 月租车过期后是否按当前日期，0是上个日期，过期N天后按当前日期 */
    @Excel(name = "月租车过期后是否按当前日期，0是上个日期，过期N天后按当前日期")
    private Long monthCarRenewDays;

    /** 云系统版本（standard-标准版、mobile-移动版、unmanned-无人值守版） */
    private String cloudVersion;

    /** 云系统版本（standard-标准版、mobile-移动版、unmanned-无人值守版） */
    @Excel(name = "云系统版本", readConverterExp = "standard-标准版、mobile-移动版、unmanned-无人值守版")
    @NeedSetDictParam(dictType = "cloud_version", dictValue = "cloudVersion")
    private String cloudVersionLabel;

    /** 创建人id */
    private Long createUser;

    /** 更新人id */
    private Long updateUser;

    /** 创建人账号 */
    //使用注解定义在参数上
//    @NeedSetValue(beanClass = SysUserMapper.class, params = "createUser", method = "selectUserById",targetFiled = "userName")
    @Excel(name = "创建人")
    private String createUserName;

    /** 更新人账号 */
//    @NeedSetValue(beanClass = SysUserMapper.class, params = "updateUser", method = "selectUserById",targetFiled = "userName")
    @Excel(name = "更新人")
    private String updateUserName;

    private SysDept dept;
    /**是否允许访客*/
    private String isVisitor;

    /**是否启用门禁功能*/
    @Excel(name = "是否启用门禁模块")
    private String isDoor;

    @Excel(name = "门禁系统版本", readConverterExp = "1：不联网版本；2：联网卡片存储版本；3：联网设备存储版本；4：人脸识别版本")
    private String doorVersions;

    /**是否启用停车功能*/
    @Excel(name = "是否启用停车模块")
    private String isPark;

    @Excel(name = "停车系统版本", readConverterExp = "cloud-云版本、edge-边缘计算版本")
    private String parkVersion;

    @Excel(name = "军警车是否收费")
    private String isPoliceFee;

    @Excel(name = "是否开启离线计费功能")
    private String isOfflineCharge;

    @Excel(name = "离线计费功能有效期截止日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date offlineChargeDate;

    @Excel(name = "是否有边缘网关服务器")
    private String isEdgeGateway;

    @Excel(name = "边缘网关设备主键id")
    private String edgeGateway;

    @Excel(name = "边缘网关设备ip")
    private String edgeGatewayIp;

    @Excel(name = "是否启用剩余车位统计")
    private String enRemain;

    /** 剩余车位数，前端显示，数据库中没有该字段 */
    @Excel(name = "剩余车位数")
    private Long remainSpace;

    private Integer initImport;

    /**扩展配置信息 json*/
    private String config;
    //是否启用多车库的多位多车功能
    private String isMultGarageCar;

    /**
     * 最大入住数
     */
    private Integer maxInNumber;

    /**
     * 物业人员是否审核家属信息
     */
    private String isPropertyExamine;

    public ParkInfo(String name) {
        this.name = name;
    }
}
